package com.menxin.queueImpl;

/**
 * Created by Menx on 2019/3/8.
 */
public class LinkedQueue<E> implements Queue<E> {

    private LinkedArray<E> list ;

    public LinkedQueue(){
        list = new LinkedArray<>();
    }

    @Override
    public void add(E e) {
        list.addLast(e);
    }

    @Override
    public E remove() {
        return list.removeFirst();
    }

    @Override
    public int getCapcatiy() {
        return list.getSize();
    }

    @Override
    public boolean isEmpty() {
        return list.isEmpty();
    }

    @Override
    public E getFront() {
        return list.get(0);
    }
}
